<template>
  <div class="layout-container static-feature-vector-evaluate">
    <FlowStep :activeStep="2" />

    <BaseInfoForm />

    <TagIcon title="一致性结果筛选展示" :style="tagIconStyle" />
    <div class="layout-container-table">
      <CommonTable
        :data="state.tableData"
        v-model:page="page"
        :total="total"
        v-loading="loading"
        :showSelection="false"
        pageLayout="prev, pager, next"
      >
        <el-table-column prop="hisSampleName" label="历史试验样本名称" />
        <el-table-column prop="matchDegree" label="整体加权匹配度" />
      </CommonTable>
    </div>

    <div class="step-buttons common-buttons">
      <el-button type="primary" @click="onBack">上一步</el-button>
      <el-button type="primary" @click="onStep">下一步</el-button>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { onMounted, reactive, ref } from 'vue';
import { Search } from '@element-plus/icons-vue';
import { ElMessage, ElMessageBox, ElTable } from 'element-plus';
import { useRoute, useRouter } from 'vue-router';
import CommonTable from '@/components/common-table/index.vue';
import { Page } from '@/components/common-table/type';
import TagIcon from '@/components/tag-icon/index.vue';
import BaseInfoForm from '../BaseInfoForm/index.vue';
import { httpGetDynamicSimilarity } from '@/api/similarityEvaluationSystem';
import FlowStep from '../FlowStep/index.vue';

let $router = useRouter();
const route = useRoute();
const tagIconStyle = reactive({ paddingLeft: '16px', paddingBottom: 0 });
const selectKeys = ref<string[]>([]);
const state = reactive<any>({
  tableData: [],
});
const loading = ref<boolean>(false);
const page = reactive<Page>({
  current: 1,
  pageSize: 500,
});
const total = ref<number>(0);

onMounted(() => {
  state.tableData = JSON.parse(sessionStorage.getItem('staticTable'));
  total.value = state.tableData?.length;
});

// 下一步
const onStep = () => {
  $router.push({
    path: '/similarityEvaluateSystem/dynamicCalculate',
    query: {
      dealSampleId: route.query.dealSampleId,
      sampleName: route.query.sampleName
    },
  });
};

// 返回上一步
const onBack = () => {
  $router.push({
    path: '/similarityEvaluateSystem/siftInfoParam',
    query: {
      dealSampleId: route.query.dealSampleId,
    },
  });
};
</script>

<style lang="scss" scoped>
@import '@/assets/style/buttons';
.static-feature-vector-evaluate {
  .layout-container-table {
    .el-button--small {
      background: transparent;
      color: rgba(24, 81, 237, 1);
    }
  }

  .step-buttons {
    display: flex;
    justify-content: center;
    box-shadow: 0px 0px 10px rgba(218, 222, 224, 1);
    padding: 10px 0;
  }
}
</style>
